<template>
  <div class="serverUser">
    <ContentBox title="企业服务" @left="back" :fixed="true" :ostyle="style" titlecolor="black">
      <template slot="oleft"><van-icon color="#000" name="arrow-left"/></template>
    </ContentBox>
    <notice class="not"></notice>
    <a class="list" :href="`${item.link}`" v-for="(item, index) in list" :key="index">
      <img :src="item.image">
      <div class="title">{{item.title}}</div>
    </a>
  </div>
</template>

<script>
export default {
  data () {
    return {
      style: {
        background: '#ffffff'
      },
      list: []
    }
  },
  mounted () {
    this.getCompanyServe()
  },
  methods: {
    back () {
      if (this.$store.state.pl === 'H5') {
        this.$router.go(-1)
      } else if (this.$store.state.pl === 'ANDROID') {
        AndroidJsBridge.finish()
      } else if (this.$store.state.pl === 'IOS') {
        window.iosCallHandler('popVC')
      }
    },
    getCompanyServe () {
      this.$axios.get('/api/company').then(res => {
        if (res.status === 200) {
          this.list = res.data.company.data
          console.log(this.list)
        }
      }).catch(err => {
        console.log(err)
      })
    }
  }
}
</script>

<style lang="scss" scoped>
@import './index.scss'
</style>
